﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using System.Web.Mvc;

namespace Vit.Web.Mvc
{
    public abstract class FilteredMetadataTypeBase<TEntity> : MetadataTypeBase<TEntity>
        where TEntity : class, new()
    {
        public abstract IQueryable<TEntity> QueryWithFilter(IQueryable<TEntity> query, object filterObject);
        public virtual object CreateFilterObject<TContext>(DataController<TContext, TEntity> controller) where TContext : DataContext, new()
        {
            TEntity obj = new TEntity();
            controller.TryUpdateFilter<TEntity>(obj);
            return obj;
        }
    }
}
